@echo off
set solutionrootdirectory=package
set solutionname=DD.SharePoint.STSADM.Extensions.wsp

echo REMINDER: Please run package.bat before this .bat

echo ----------------------------------------------
echo Retracting solution %solutionname% from all servers
echo ----------------------------------------------

stsadm -o retractsolution -name %solutionname% -immediate
stsadm -o execadmsvcjobs

echo ----------------------------------------------
echo Deleting solution %solutionname% from solution store
echo ----------------------------------------------

stsadm -o deletesolution -name %solutionname%
stsadm -o execadmsvcjobs

echo ----------------------------------------------
echo Adding solution %solutionname% to solution store
echo ----------------------------------------------

stsadm -o addsolution -filename "%solutionrootdirectory%\%solutionname%"
stsadm -o execadmsvcjobs

echo ----------------------------------------------
echo Deploying solution %solutionname% to all servers
echo ----------------------------------------------

stsadm -o deploysolution -name %solutionname% -immediate -allowgacdeployment
stsadm -o execadmsvcjobs

echo End of operations
